<?php 
namespace app\common\model;
class Evas extends Common{
	protected $insert = ['addtime'=>SYS_TIME];
	public function getAddtimeAttr($value, $data){
		return date('Y-m-d H:i:s', $value);
	}
	public function getUsernameAttr($value, $data){
		$username = model('Member')->where('id',$data['userid'])->value('username');
		return $username;
	}
	public function getContentobjAttr($value, $data){
		$contentobj = model('Requires')->where('id',$data['contentid'])->value('title');
		return $contentobj;
	}
	public function getTypeidAttr($value, $data){
		return $value == 1 ? '需求订单' : '未知' ;
	}
	public function getNicknameAttr($value, $data){
		$info = model('Member')->where('id',$data['userid'])->find();
		return $info['nickname'];
	}
	public function getAvatarAttr($value, $data){
		$avatar = model('Member')->where('id',$data['userid'])->value('avatar');
		return $avatar;
	}
}